import request from "@/utils/request.js"

export const getRecommendBookList = () => {
  return request.get("/book/recommend")
}

export const getBookPage = (data) => {
  return request.post("/book/page", data)
}

export const addBook = (data) => {
  return request.post("/book", data)
}

export const getBookById = (id) => {
  return request.get("/book/" + id)
}

export const updateBook = (data) => {
  return request.put("/book", data)
}

export const borrowBook = (data) => {
  return request.post("/book/borrow", data)
}

export const getCurrentBorrowBook = (data) => {
  return request.post("/book/current", data)
}

export const returnBook = (id) => {
  return request.post("/book/return/" + id)
}

export const confirmReturn = (id) => {
  return request.post("/book/confirm/" + id)
}
